# -*- coding:utf-8 -*-
# 鼠标点击
import time
from selenium import webdriver
from selenium.webdriver.common.by import By         # 导入浏览器驱动定位方法By
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
driver.get("http://sahitest.com/demo/clicks.htm")


# 定位单击元素
click = driver.find_element(By.XPATH, '/html/body/form/input[3]')

# 定位双击元素
double_click = driver.find_element(By.XPATH, '/html/body/form/input[2]')

# 定位右击元素
right_click = driver.find_element(By.XPATH, '/html/body/form/input[4]')


ActionChains(driver).click(click).double_click(double_click).context_click(right_click).perform()